//
//  SingleImageCell.m
//  QuXiang
//
//  Created by Duncan on 2020/6/18.
//  Copyright © 2020 NanHuaiZi. All rights reserved.
//

#import "SingleImageCell.h"

@implementation SingleImageCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        self.backgroundColor = [UIColor clearColor];
        [self.contentView addSubview:self.singleImageView];
        [self masonryLayout];
    }
    return self;
}

/// 左右15边距
- (void)leftRightMasLayout {
    [self.singleImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.mas_left).offset(kFragmemtFloat(16));
        make.right.equalTo(self.contentView.mas_right).offset(-kFragmemtFloat(16));
        make.top.bottom.equalTo(self.contentView);
    }];
}

/// 完善信息
- (void)informationTopMasLayout {
    
}

#pragma mark ------- Lazy Methods -------

- (void)masonryLayout {
    [self.singleImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.contentView);
    }];
}

- (UIImageView *)singleImageView {
    if (!_singleImageView) {
        _singleImageView = [[UIImageView alloc] init];
    }
    return _singleImageView;
}

@end
